#!/bin/bash
## kola:
##   exclusive: false
##   description: Verify logrotate and logrotate.timer services are enabled.
##   tags: "platform-independent"

set -xeuo pipefail

# shellcheck disable=SC1091
. "$KOLA_EXT_DATA/commonlib.sh"

for unit in logrotate logrotate.timer; do
    if ! systemctl is-enabled ${unit} 1>/dev/null; then
        fatal "Unit ${unit} should be enabled"
    fi
    ok "Unit ${unit} is enabled as expected"
done
